package com.controller;

import com.entity.UserEntity;
import com.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    public UserServiceImpl service;

    @RequestMapping("/list/{pageNum}/{pageSize}")
    public List<UserEntity> selectPagedUsers(@PathVariable("pageNum") Integer pageNum,
                                             @PathVariable("pageSize") Integer pageSize){
        return service.selectPagedUsers(pageNum, pageSize);
    }

    @RequestMapping("")
    public void selectPagedUsers(){
        service.txServices();
    }
}
